<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
/**
 * 店铺结算表
 */
class CreateSettlementTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('settlement', function (Blueprint $table) {
            $table->increments('id');
	        $table->string('period',50)->comment('结算账期');
	        $table->integer('store_id')->comment('结算店铺id');
	        $table->string('store_name')->comment('结算店铺名称');
	        $table->date('start_time')->comment('结算开始日期');
	        $table->date('end_time')->comment('结算结束日期');
//	        $table->integer('create_uid')->comment('创建人id');
//	        $table->string('create_name')->comment('创建人姓名');
	        $table->integer('status')->comment('状态：1未结算，2结算中，3分配奖金中，4已结算')->default(1);
	        $table->integer('statu')->comment('分配状态：1未分配，2已分配')->default(1);
	        $table->double('sum_hour')->comment('结算总工时')->nullable();
	        $table->decimal('sum_money')->comment('结算总金额')->nullable();
	        $table->double('should_hour')->comment('店铺应满工时')->nullable();
	        $table->double('actual_hour')->comment('店铺实际工时')->nullable();
	        $table->string('owner_name')->comment('店长名称')->nullable();
	        $table->decimal('reward')->comment('店铺奖金额度')->nullable();
	        $table->integer('company_id')->comment('公司id');
	        $table->integer('is_agree')->comment('审核：1申请中，2已同意，3不通过')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('settlement');
    }
}
